<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title><?php echo isset(${lang('field_seo_title')})?${lang('field_seo_title')}:(empty(${lang('field_head_title')})?${lang('field_site_title')}:${lang('field_head_title')});?></title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta name="keywords" content="<?php echo isset(${lang('field_seo_keywords')})?${lang('field_seo_keywords')}:(empty(${lang('field_head_keywords')})?${lang('field_site_keywords')}:${lang('field_head_keywords')});?>" />
    <meta name="description" content="<?php echo isset(${lang('field_seo_description')})?${lang('field_seo_description')}:(empty(${lang('field_head_description')})?${lang('field_site_description')}:${lang('field_head_description')});?>" />
    <base href="<?php echo base_url();?>public/default/" />
    <link rel="shortcut icon" href="favicon.ico" />
    <link href="css/common.css" type="text/css" rel="stylesheet" />
    <script src="../plugins/jquery-1.7.1.min.js" type="text/javascript"></script>
    <script src="../plugins/jquery.cookie.js" type="text/javascript"></script>
    <script src="js/<?php echo lang('page_js_lang');?>" type="text/javascript"></script>
    <script src="js/common.js" type="text/javascript"></script>
    <script type="text/javascript">
        var url_member_check = '<?php echo site_url('ajax/member_handle/check')?>';
        var url_member_logout = '<?php echo site_url('ajax/member_handle/logout')?>';
        var url_member_login = '<?php echo site_url('member/login')?>';
        var url_member_register = '<?php echo site_url('member/register')?>';
        var url_member_index = '<?php echo site_url('member/index')?>';
        var url_product_search = '<?php echo site_url('home/search')?>';
        var url_check_verify = '<?php echo site_url('ajax/guestbook_handle/check_verify')?>';
        var url_guestbook_save = '<?php echo site_url('ajax/guestbook_handle/save')?>';
    </script>
</head>
<body>
<div class="wrap">
    <div class="header">
        <a class="logo" href="<?php  echo site_url('index');?>"><img height="80" src="<?php echo up_path($site_logo,'img','images/logo.png');?>" alt="logo" /></a>
        <div class="toolbar">
            <span id="member_bar">
            </span>
            <a href="javascript:SetHomePage()"><?php echo lang('page_set_homepage');?></a>
            <a href="javascript:AddFavorite('<?php echo $site_name;?>')"><?php echo lang('page_add_favorites');?></a>
            <a href="javascript:switch_language()"><?php echo lang('page_switch_language');?></a>
        </div>
        <div class="search">
            <input class="search_key" id="search_key" value="<?php echo lang('page_input_search');?>" onfocus="Cls(this,'<?php echo lang('page_input_search');?>',true)" type="text"/>
            <input class="btn search_btn" value="<?php echo lang('page_btn_search');?>" onclick="GoSearch(url_product_search,'search_key',<?php echo ($request=='home/search'||$request=='home/product_list')?'false':'true'?>)" type="button" />
        </div>
    </div>
    
    <div class="nav">
        <!--nav start-->
        <ul>        
            <?php $nav_count=count($nav);$li_width=$nav_count>0?floor(1000/$nav_count):0;?>
            <?php foreach ($nav as $k=>$v){?>
            <li <?php echo in_array($request,explode('|',$v['selected_uri']))?'class="selected"':'';?> style="width:<?php echo $li_width;?>px">
                <a href="<?php echo $v['uri']?>" <?php echo $v['target']?'target="_blank"':'';?>><?php echo $v[lang('field_links_title')];?></a>
                <!--
                <?php if(isset($sub_menus_category[$v['sub_id']])){?>
                    <ul>
                    <?php foreach ($sub_menus_category[$v['sub_id']] as $sub){?>
                    <li><a href="<?php echo site_url($sub['list_uri'].'/'.$sub['id']);?>"><?php echo $sub[lang('field_links_title')];?></a></li>
                    <?php }?>
                    </ul>
                <?php }?>                
                <?php if(isset($sub_menus_content[$v['sub_id']])){?>
                    <ul>
                    <?php foreach ($sub_menus_content[$v['sub_id']] as $sub){?>
                    <li><a href="<?php echo site_url($sub['uri'].'/'.$sub['id']);?>"><?php echo $sub[lang('field_links_title')];?></a></li>
                    <?php }?>
                    </ul>
                <?php }?>
                -->
            </li>
            <?php }?>
        </ul>
        <!--nav end-->
    </div>

    <div class="banner">
        <!--banner start-->        
        <?php
        if(!empty($banner_data) && !empty($banner_style))
        {
            $this->load->view("banner_$banner_style");
        }
        ?>  
        <!--banner end-->
    </div>
    
    <!--content start-->
    <?php
    if(isset($content_view))
    {
        $this->load->view($content_view);
    }
    ?>
    <!--content end-->

    <div class="footer">
        <!--footer start-->
        <?php echo ${lang('field_site_footer')};?>
        <!--footer end-->          
              
    </div>
</div>

<div class="bottom_background"></div>

<!--kf start-->
<?php if(!empty($kf_list)){?>
<div id="kf_wrap" style="position:absolute; top:200px; left:0px;">
    <img id="kf_sidebar" style="display:inline-block;" src="../plugins/kf/kf_side.jpg" alt="在线客服"/>
    <div id="kf_main" style="width:118px; display: none;">
        <div style="height:55px; background:url(../plugins/kf/up_001.gif) bottom center no-repeat;"></div>
        <ul style="text-align:center; background:url(../plugins/kf/mid001.gif) center repeat-y;">
            <?php foreach ($kf_list as $kf){?>
                    <li style="padding:3px 0px;">
                        <a target="_blank" href="<?php echo $kf['uri'];?>"><img border="0" src="<?php echo $kf['img_cover'];?>" alt="<?php echo $kf['title'];?>" title="<?php echo $kf['description'];?>"></a>
                    </li>
            <?php }?>                
        </ul>
        <div style="height: 21px; background:url(../plugins/kf/bot_001.gif) top center no-repeat;"></div>
    </div>
</div>
<?php }?>
<!--kf end-->

<!--third script start-->
<div style="display:none">
<?php echo $third_script;?>
</div>
<!--third script end-->
</body>
</html>